#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QLabel>   //标签
#include <QPushButton>  //按钮
#include <QLineEdit>    //编辑框   ctrl+/注释
#include <QKeyEvent>
#include "model/configuremodel.h"
#include <QMessageBox>
#include "sliderscreen.h"
#include <QCryptographicHash>
#include "model/usermodel.h"
#include "model/logmodel.h"
#include <QCloseEvent>
#include <QDateTime>
#include <QTime>
#include <QChar>

class LoginWidget : public QWidget
{
    Q_OBJECT
public:
    //构造函数类型转换构造
    explicit LoginWidget(QWidget *parent = nullptr);
    ~LoginWidget();
    void init_window();
    void init_control();
    void init_connect();
    void init_qss();

    //加密函数
    QString MD5Encryption(const QString &str);
    //表单清空
    void clearForm();

protected:

private:
    QLabel *title, *equipment, *name, *password, *check, *input;
    QLineEdit *equipEdit, *nameEdit, *passwordEdit, *checkEdit;
    QPushButton *enterBtn, *backBtn, *checkBtn, *changeBtn;
    sliderscreen * sl;
    //是否是密文
    bool isPassword;

public slots:
    void CheckLogin();
    void setMode();
    void doLogin();

signals:
    //取消按钮的返回
    void backToMain1();
    //登录后返回主界面
    void backToMain2();


    // QWidget interface
protected:
//    void closeEvent(QCloseEvent *event);
};

#endif // LOGINWIDGET_H
